import request from '@/utils/request'

export function submit(data) {
  return request({
    url: 'buss/contractormanagement/add',
    method: 'post',
    data
  })
}

export function getOne(id) {
  return request.get('buss/contractormanagement/getOne?id='+id)
}

export function getTablePage(data) {
  return request.post('buss/contractormanagement/getContractorPaging', data)
}

export function del(ids) {
  return request({
    url: 'buss/contractormanagement/del',
    method: 'post',
    data: ids
  })
}

export function resubmit(data) {
  return request({
    url: 'buss/contractormanagement/edit',
    method: 'post',
    data
  })
}

export function downfile(data) {
  return request({
    url: 'buss/contractormanagement/downfile?name='+data,
    method: 'post',
    responseType: 'blob'
  })
}

export function getContractByCompanyName(data) {
  return request.post('buss/contractormanagement/getContractByCompanyName',data)
}

export function getStatistics(data) {
  return request.post('buss/contractormanagement/getStatistics', data)
}

export function importExcel(data) {
  return request.post('buss/contractormanagement/importContractorExcel', data)
}

export function exportExcel(data) {
  return request({
    method: 'post',
    url: 'buss/contractormanagement/exportExcel',
    data: data,
    responseType: 'blob'
  })
}



export function creditEvaluationPaging(data) {
  return request.post('buss/creditevaluation/creditEvaluationPaging', data)
}


export function getProjectByCompanyName(data) {
  return request.post('buss/contractormanagement/getProjectByCompanyName?contractorManagementId='+data,)
}


export function getContractByProjectId(data) {
  return request.post('buss/contractormanagement/getContractByProjectId',data)
}


export function getTotalScoreByYear(data) {
  return request.post('buss/creditevaluation/getTotalScoreByYear',data)
}


export function creditEvaluationGetOne(id) {
  return request.post('buss/creditevaluation/creditEvaluationGetOne?id='+id)
}


export function getDetailedScoreData(data) {
  return request.post('buss/contractormanagement/getDetailedScoreData?contractorManagementId='+data)
}



export function creditEvaluationDelete(ids) {
  return request({
    url: 'buss/creditevaluation/creditEvaluationDelete',
    method: 'post',
    data: ids
  })
}

export function getSupplier(data) {
  return request.post('buss/contractormanagement/getSupplier',data)
}


export default {
  submit,
  getOne,
  del,
  resubmit,
  getTablePage,
  downfile,
  getContractByCompanyName,
  getStatistics,
  importExcel,
  exportExcel,

  creditEvaluationPaging,
  getProjectByCompanyName,
  getContractByProjectId,
  getTotalScoreByYear,
  creditEvaluationGetOne,
  creditEvaluationDelete,

  getDetailedScoreData,
  getSupplier
}
